<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>3D旋转</title>
  <style>
    ul {
      margin: 100px;
    }

    ul li {
      width: 120px;
      height: 35px;
      list-style: none;
      perspective: 500px;
    }

    .box {
      position: relative;
      width: 100%;
      height: 100%;
      transform-style: preserve-3d ;
      transition: all 0.6s;
    }
    .box:hover {
      transform: rotateX(90deg);
    }

    .front,
    .back {
      position: absolute;
      left: 0;
      right: 0;
      width: 100%;
      height: 100%;
    }

    .front {
      background-color: pink;
      z-index: 1;
      transform: translateZ(17.5px);
    }
 
    .back {
      background-color: blue;
      transform: translateY(17.5px) rotateX(-90deg);
    }
  </style>
</head>

<body>
  <ul>
    <li>
      <div class="box">
        <div class="front">正</div>
        <div class="back">负</div>
      </div>
    </li>
  </ul>
</body>

</html>